fix: enforce single-instance using QLockFile#117
Merged
ErikBjare merged 3 commits intoActivityWatch:masterfrom Feb 27, 2026
Merged
fix: enforce single-instance using QLockFile#117ErikBjare merged 3 commits intoActivityWatch:masterfrom
ErikBjare merged 3 commits intoActivityWatch:masterfrom
Conversation
Uses Qt's cross-platform QLockFile to prevent multiple instances of aw-qt from running simultaneously. When a second launch is attempted, it logs a warning (including the PID of the existing instance) and exits with code 1. Testing mode gets its own lock file so it doesn't conflict with a normal production instance. Fixes ActivityWatch/activitywatch#1176
2 tasks
There was a problem hiding this comment.
Important
Looks good to me! 👍
Reviewed everything up to 827d660 in 6 seconds. Click for details.
- Reviewed
58lines of code in1files - Skipped
0files when reviewing. - Skipped posting
0draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
Workflow ID: wflow_WSmqMFjeCPyzsfIo
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
ErikBjare
reviewed
Feb 27, 2026
| """ | ||
| import aw_core.dirs | ||
|
|
||
| data_dir = aw_core.dirs.get_data_dir("aw-qt") |
Greptile SummaryAdds single-instance enforcement to aw-qt using Qt's
Confidence Score: 5/5
Important Files Changed
Last reviewed commit: 827d660 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Prevents multiple instances of aw-qt from running simultaneously by using Qt's built-in
QLockFile.aw-qt-testing.lock) to avoid conflicts with a production instanceImplementation
QLockFilefromPyQt6.QtCorewas chosen because:PyQt6is an existing dependencyThe lock is acquired after logging is set up (so the warning lands in the log file) but before modules are started (so no partial startup occurs).
Related
Fixes ActivityWatch/activitywatch#1176
cc @ErikBjare
Important
Prevents multiple
aw-qtinstances usingQLockFile, logging a warning and exiting if another instance is running.aw-qtinstances usingQLockFileinmain.py.aw-qt-testing.lockfor testing mode to avoid conflicts._acquire_single_instance_lock()function inmain.pyto handle lock acquisition.This description was created by
for 827d660. You can customize this summary. It will automatically update as commits are pushed.